{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f1312a4d",
   "metadata": {},
   "outputs": [],
   "source": [
    "import hanlp"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "42ac8a3e",
   "metadata": {},
   "source": [
    "### 中文NEG"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b79f1145",
   "metadata": {},
   "outputs": [],
   "source": [
    "zh_neg = hanlp.load(hanlp.pretrained.ner.MSRA_NER_BERT_BASE_ZH)\n",
    "\n",
    "zh_content = '上海华安工业（集团）公司董事长谭晓光和秘书张晚霞来到美国纽约现代艺术博物馆参观'\n",
    "\n",
    "result = zh_neg(list(zh_content))\n",
    "\n",
    "result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f119d098",
   "metadata": {},
   "outputs": [],
   "source": [
    "en_reg = hanlp.load(hanlp.pretrained.ner.CONLL03_NER_BERT_BASE_UNCASED_EN)\n",
    "\n",
    "en_content = 'President Obama is speaking at the White House'\n",
    "\n",
    "eng_result = en_reg(list(en_content.split()))\n",
    "\n",
    "eng_result"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "7cacf990",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "torchX",
   "language": "python",
   "name": "torchx"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.11"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
